<template>
<div>
    <el-tabs v-model="activeName1" type="border-card" class="demo-tabs2">
        <el-tab-pane label="指定方法" name="method" lazy>
            <method ref="methodRef" :initMsg="props.initMsg.method" :isRead="props.isRead" class="tabIn"/>
        </el-tab-pane>
        <el-tab-pane label="风控项目" name="risk" lazy>
            <risk ref="riskRef" :initMsg="props.initMsg.risk" :isRead="props.isRead" class="tabIn"/> 
        </el-tab-pane>                       
    </el-tabs>
</div>
</template>

<script setup lang="ts">
import Method from '@/components/LogicFlow/demo/FlowConfig/action/method.vue';
import Risk from '@/components/LogicFlow/demo/FlowConfig/action/risk.vue';

const props = defineProps({
    initMsg: { type: Object, default: () => ({}) },
    isRead: {
        type: Boolean,
        default: false
    }
})
let $emit = defineEmits(['reQuery','closeDig']);
onMounted(() => {
    init()
})
const init = () => {
};
const methodRef = ref();
const riskRef = ref();
const save = ()=>{
    let subObj = {
        method: methodRef.value?.save(),
        risk: riskRef.value?.save(),
    }
    return subObj;
}

const activeName1 = ref('method');

// 暴露save方法给父组件调用
defineExpose({
    save
});
</script>

<style scoped lang="scss">
:deep(.demo-tabs2){ height: 100%;
    &>.el-tabs__content{ padding: 0 10px 0 0; height: 100%;
        .el-tab-pane{ height: 100%;}
    }
}
.tabIn{
    height: 100%;
    padding: 10px;
}
</style>
